<template>
  <div class="registerView">
    <strong>注册界面</strong>
    <el-input @keyup.enter="register(name, password, email)" v-model="name" placeholder="请输入名称" style="width: 300px" clearable />
    <el-input @keyup.enter="register(name, password, email)" v-model="password" type="password" placeholder="请输入密码" style="width: 300px" clearable />
    <el-input @keyup.enter="register(name, password, email)" v-model="email" placeholder="请输入邮箱" style="width: 300px" clearable />
    <div style="flex-direction: row;">
      <el-button @click="register(name, password, email)">注册</el-button>
      <el-button @click="toView('Login')">前往登录</el-button>
    </div>
  </div>
</template>

<script setup lang="ts">
import {register} from '@/views/RegisterView/Hooks.ts';
import {toView} from '@/utils/utils';

const email: Ref<string> = ref('');
const password: Ref<string> = ref('');
const name: Ref<string> = ref('');
</script>

<style scoped lang="less">
.registerView {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  strong {
    margin: 10px 0;
    font-size: 20px;
  }
}
</style>
